---
import { ClientRouter } from 'astro:transitions'
import Analytics from '@vercel/analytics/astro'

import '@/styles/global.css'

import Header from '@/sections/Header.astro'
import Footer from '@/sections/Footer.astro'
import Sponsors from '@/sections/Sponsors.astro'
import BannerSponsors from '@/sections/BannerSponsors.astro'
import { fixedTitle } from '@/consts/pageTitles'
import Spotlight from '@/components/Spotlight.astro'
interface Props {
  title: string
  description?: string
  canonical?: string
  robots?: string
}

const {
  title = fixedTitle,
  description = 'Evento de boxeo aficionado entre streamers y creadores de contenido, organizado por Ibai Llanos',
  canonical,
  robots,
} = Astro.props
---

<!doctype html>
<html lang="es">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width" />
    <title>
      {title}
    </title>

    <link rel="icon" type="image/svg+xml" href="/favicon.svg" />

    <!-- Preload de las fuentes para que no se vea el cambio de fuente al cargar la pagina -->
    <link
      rel="preload"
      href="/fonts/anisette-medium.woff2"
      as="font"
      type="font/woff2"
      crossorigin="anonymous"
    />
    <link
      rel="preload"
      href="/fonts/anisette-bold.woff2"
      as="font"
      type="font/woff2"
      crossorigin="anonymous"
    />
    <meta name="description" content={description} />
    {canonical && <link rel="canonical" href={canonical} />}
    {robots && <meta name="robots" content={robots} />}

    <meta property="og:url" content="https://www.infolavelada.com" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content={title} />
    <meta property="og:description" content={description} />
    <meta property="og:image" content="https://www.infolavelada.com/og.jpg" />
    <meta property="og:locale" content="es_ES" />
    <meta property="og:site_name" content="La Velada del Año V" />

    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:site" content="@infoLaVelada" />
    <meta name="twitter:creator" content="@ibaiLlanos" />
    <meta name="twitter:title" content={title} />
    <meta name="twitter:description" content={description} />
    <meta name="twitter:image" content="https://www.infolavelada.com/og.jpg" />

    <script type="speculationrules">
      {
        "prerender": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }],
        "prefetch": [{ "where": { "href_matches": "/*" }, "eagerness": "moderate" }]
      }
    </script>

    <!-- Datos estructurados para Evento (Schema.org) -->
    <script type="application/ld+json">
      {
        "@context": "https://schema.org",
        "@type": "Event",
        "name": "La Velada del Año V",
        "description": "Evento de boxeo aficionado entre streamers y creadores de contenido, organizado por Ibai Llanos",
        "image": "https://www.infolavelada.com/og.jpg",
        "startDate": "2025-07-26T18:00:00+02:00",
        "endDate": "2025-07-27T02:00:00+02:00",
        "eventStatus": "https://schema.org/EventScheduled",
        "eventAttendanceMode": "https://schema.org/OfflineEventAttendanceMode",
        "location": {
          "@type": "Place",
          "name": "Estadio La Cartuja",
          "address": {
            "@type": "PostalAddress",
            "addressLocality": "Sevilla",
            "addressRegion": "Andalucía",
            "addressCountry": "ES"
          }
        },
        "organizer": {
          "@type": "Person",
          "name": "Ibai Llanos"
        },
        "offers": {
          "@type": "Offer",
          "url": "https://www.entradas.com/artist/la-velada-del-ano/la-velada-del-ano-v-3883352/?affiliate=LVL",
          "availability": "https://schema.org/InStock",
          "priceCurrency": "EUR",
          "validFrom": "2025-04-01T12:00:00+02:00"
        },
        "performer": {
          "@type": "PerformingGroup",
          "name": "Creadores de contenido"
        }
      }
    </script>
    <ClientRouter />
    <Analytics />
  </head>
  <body>
    <Spotlight />
    <Header />

    <a href="#main-content" class="sr-only focus:not-sr-only"> Saltar al contenido principal </a>

    <main id="main-content">
      <div
        transition:persist
        class="mask-fade-bottom absolute inset-0 w-full bg-[url('/images/hero.avif')] bg-cover bg-center"
      >
      </div>
      <slot />
    </main>
    <BannerSponsors />
    <Sponsors />
    <Footer />
  </body>
</html>
